<?php 
class MainBannerWidget extends CWidget {
 
    public function run() {
	if($this->check_visible())
	    $this->render('main_banner');
    }
    protected function check_visible(){
	$visible = false;
	switch (Yii::app()->controller->id){
	    case 'main':
		switch (Yii::app()->controller->action->id){
		    case 'index':
			$visible = TRUE;
		    break;
		}
	    break;
	}
	return $visible;
    }
}
?>